<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/conn.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/webConfig.php';

$pageTitle = '申请充值';

require_once 'inc_header.php';
require_once 't.php';
?>
<style type="text/css">
<!--
.STYLE1 {
	color: #FF0000;
	font-size: 18px;
}
.STYLE2 {font-size: 18px}
-->
</style>

  
<?php
$sql = "select *,(select count(id) from `h_member` where h_parentUserName = a.h_userName and h_isPass = 1) as comMembers from `h_member` a where h_userName = '{$memberLogged_userName}' LIMIT 1";
$rs = $db->get_one($sql);
?>
   
   <!--主-->
   <br><center>
     <span class="STYLE1">提交申请前，请扫描下方二维码进行付款!客服QQ：<?php echo $webInfo['h_serviceQQ']; ?></span>
   </center><br> 
   
<form class="form-horizontal">
<div class="personal-info-item">
            <span id="ctl00_body_Label1" class="personal-info-line personal-info-label">充值金额</span>
            <label class="personal-info-line-split">:</label>
            <input class="friend-new-line friend-new-line-input" id="x2" placeholder="充值金额" value="" maxlength="10">
        </div>
		<div class="personal-info-item">
            <span id="ctl00_body_Label1" class="personal-info-line personal-info-label">充值方式</span>
            <label class="personal-info-line-split">:</label>
                   	  <select class="friend-new-line friend-new-line-input" id="x3" name="x3">
	  <option value=""></option>
<option value="微信支付">微信支付</option>
<option value="支付宝">支付宝</option>
</select>
        </div>
		<div class="personal-info-item">
            <span id="ctl00_body_Label1" class="personal-info-line personal-info-label">交易号</span>
            <label class="personal-info-line-split">:</label>
           <input class="friend-new-line friend-new-line-input" id="x18" placeholder="请输入转账交易号后10位" value="" maxlength="10">
        </div>
    <button type="submit" class="btn friend-new-sub goumai_go" id="x4-cos">申请充值</button>
</form>


<div class="panel">
<?php
$codeimg = $db->get_one("select `h_wxczcode` from `h_config`");
$codeimg1 = $db->get_one("select `h_zfbczcode` from `h_config`");
?>

<table width="100%" cellpadding="1" border="1" >
  <tr>
    <th><div align="center" class="STYLE2">微信扫码支付</div></th>
  </tr>
  <tr>
    <th><div align="center"><img src="/888.jpg" width="200" height="200" /></div></th>
  </tr>
  <tr>
    <th><div align="center" class="STYLE2">支付宝扫码支付</div></th>
  </tr>
  <tr>
    <th><div align="center"><img src="/999.jpg" width="200" height="200" /></div></th>
  </tr>
</table>

</div>
</div>
</div>
<!--MAN End-->


</div></div> 

<script>
	mgo(35);
	var zhituis=<?php echo $rs['comMembers'];?>;
	$(".goumai_go").click(function () {
			goumai_go();
			//layer.msg("本功能12月10号开发,尽请期待!");
			return false;
		});	
	function goumai_go(){
		
		if($("#x2").val()==""){
			tishi4("请输入填写充值金额",'#x2');
			return false;
			}
        if($("#x3").val()==""){
			tishi4("请选择充值方式！",'#x3');
			return false;
			}
		if($("#x18").val()==""){
			tishi4("请输入交易号后10位",'#x18');
			return false;
			}
		if(!checkNum($("#x2").val()) || $("#x2").val()<<?php echo $webInfo['h_chongzhiMinMoney']; ?>){
			tishi4("充值金额<?php echo $webInfo['h_chongzhiMinMoney']; ?>元起,请输入<?php echo $webInfo['h_chongzhiMinMoney']; ?>以上的整数",'#x2');
			return false;
			}
		
		
		
		layer.msg("共计充值"+$("#x2").val()+"元,确认无误请点击确定充值",{time: 20000, btn: ['确定充值', '我点错了'],btn1: function(){goumai_go2()}});

		}
	function goumai_go2(){
		tishi2();
		//+"&x4="+encodeURI($("#x5").prop('checked'))
$.get("/mobile/bin.php?act=point2_chongzhi&num="+encodeURI($("#x2").val())+"&alipayUserName="+encodeURI($("#x3").val())+"&jiaoyihao="+encodeURI($("#x18").val())+"&alipayFullName="+encodeURI($("#x4").val()),function(e){
			tishi2close();
			if(e!=""){
				$("#x4-cos").html(unescape(e));
				if($("#x4-cos").text().substr(0,6)=="申请充值成功"){
					layer.msg("申请充值成功",{end:function(){location.reload();}});
					}
				}	
			},'html'
			);
		}	
		
	
    </script>
    
<?php
require_once 'f.php';
require_once 'inc_footer.php';
?>